#ifndef GAMEWINDOW_H
#define GAMEWINDOW_H

#include <QWidget>
#include <QPainter>
#include <QPushButton>

#include "gameclient.h"

class GameWindow : public QWidget
{
    Q_OBJECT
public:
    explicit GameWindow(GameClient* clientPt, QWidget *parent = nullptr);

    static constexpr int cardWidth = 60;
    static constexpr int cardHeight = 100;

    // left up corner of hand cards area
    static constexpr int handCardsAreaX = 40;
    static constexpr int handCardsAreaY = 400;

signals:

protected:
    void paintEvent(QPaintEvent* e);
    void closeEvent(QCloseEvent* e);
    void mousePressEvent(QMouseEvent* e);

private slots:
    void onClientStateChanged();
    void onclientUpdated();
    void onCardsPosted(bool);

private:
    void initUi();
    void initConnections();
    void setButtons();
    void disableButtons();
    void getActionsText(QString act[]);
    void drawCards(QPainter& p);
    void drawPrompt(QPainter& p);
    void drawPlayerStates(QPainter& p);

    QPushButton *btnYes, *btnNo;

    GameClient *client;
};

#endif // GAMEWINDOW_H
